package com.nageoffer.shortlink.project.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.nageoffer.shortlink.common.convention.result.Result;
import com.nageoffer.shortlink.common.dto.project.req.ShortLinkCreateReqDTO;
import com.nageoffer.shortlink.common.dto.project.resp.ShortLinkCreateRespDTO;

//服务熔断后的降级策略
public class CustomBlockHandler {
    public static Result<ShortLinkCreateRespDTO> createShortLinkBlockHandlerMethod(ShortLinkCreateReqDTO reqParam, BlockException exception){
        return new Result<ShortLinkCreateRespDTO>().setCode("B100000").setMessage("当前访问过于频繁，请稍后重试");
    }
}
